package com.diandiansong.app.entity;

import com.google.gson.annotations.SerializedName;

import java.util.List;

import diandiansong.library.utils.BaseEntity;

public class CartSettleInfo extends BaseEntity {

    /**
     * message : null
     * data : {"address_info":{"addr_id":"8","name":"这么好了","mobile":"18238833662","location":"浙江省杭州市上城区这么晚的"},"info_list":[{"goods_title":"空心菜",
     * "goods_id":"35","cart_id":"0","sku_sum":"0","sku_product_id":"14","unit":"斤","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-07-26/62067781f3aebb65c16b5942c8d3aa3ae8.jpg","sku_price":"0.01","sku_product_text":"小+1斤，2斤，3斤，"}],
     * "order_pay_amount":"0","cost_freight":"0","sum_total":"0","pay_amount":"0","provider_id":"1"}
     */

    @SerializedName("data")
    private Data data;

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public static class Data {
        /**
         * address_info : {"addr_id":"8","name":"这么好了","mobile":"18238833662","location":"浙江省杭州市上城区这么晚的"}
         * info_list : [{"goods_title":"空心菜","goods_id":"35","cart_id":"0","sku_sum":"0","sku_product_id":"14","unit":"斤",
         * "imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/62067781f3aebb65c16b5942c8d3aa3ae8.jpg","sku_price":"0.01",
         * "sku_product_text":"小+1斤，2斤，3斤，"}]
         * order_pay_amount : 0
         * cost_freight : 0
         * sum_total : 0
         * pay_amount : 0
         * provider_id : 1
         */

        @SerializedName("address_info")
        private AddressInfo addressInfo;
        @SerializedName("order_pay_amount")
        private String orderPayAmount;
        @SerializedName("cost_freight")
        private String costFreight;
        @SerializedName("sum_total")
        private String sumTotal;
        @SerializedName("pay_amount")
        private String payAmount;
        @SerializedName("provider_id")
        private String providerId;
        @SerializedName("gift_sum")
        private String gift_sum;
        @SerializedName("info_list")
        private List<InfoList> infoList;

        public AddressInfo getAddressInfo() {
            return addressInfo;
        }

        public void setAddressInfo(AddressInfo addressInfo) {
            this.addressInfo = addressInfo;
        }

        public String getOrderPayAmount() {
            return orderPayAmount;
        }

        public void setOrderPayAmount(String orderPayAmount) {
            this.orderPayAmount = orderPayAmount;
        }

        public String getCostFreight() {
            return costFreight;
        }

        public void setCostFreight(String costFreight) {
            this.costFreight = costFreight;
        }

        public String getSumTotal() {
            return sumTotal;
        }

        public void setSumTotal(String sumTotal) {
            this.sumTotal = sumTotal;
        }

        public String getPayAmount() {
            return payAmount;
        }

        public void setPayAmount(String payAmount) {
            this.payAmount = payAmount;
        }

        public String getProviderId() {
            return providerId;
        }

        public void setProviderId(String providerId) {
            this.providerId = providerId;
        }

        public List<InfoList> getInfoList() {
            return infoList;
        }

        public void setInfoList(List<InfoList> infoList) {
            this.infoList = infoList;
        }

        public String getGift_sum() {
            return gift_sum;
        }

        public void setGift_sum(String gift_sum) {
            this.gift_sum = gift_sum;
        }

        public boolean showGift() {
            int sum = 0;
            try {
                sum = Integer.valueOf(gift_sum);
            } catch (Exception ignore) {
            }
            return sum != 0;
        }

        public static class AddressInfo {
            /**
             * addr_id : 8
             * name : 这么好了
             * mobile : 18238833662
             * location : 浙江省杭州市上城区这么晚的
             */

            @SerializedName("addr_id")
            private String addrId;
            @SerializedName("name")
            private String name;
            @SerializedName("mobile")
            private String mobile;
            @SerializedName("location")
            private String location;

            public String getAddrId() {
                return addrId;
            }

            public void setAddrId(String addrId) {
                this.addrId = addrId;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getMobile() {
                return mobile;
            }

            public void setMobile(String mobile) {
                this.mobile = mobile;
            }

            public String getLocation() {
                return location;
            }

            public void setLocation(String location) {
                this.location = location;
            }
        }

        public static class InfoList {
            /**
             * goods_title : 空心菜
             * goods_id : 35
             * cart_id : 0
             * sku_sum : 0
             * sku_product_id : 14
             * unit : 斤
             * imgs : http://h3.mobilekoudai.com/uploads/2018-07-26/62067781f3aebb65c16b5942c8d3aa3ae8.jpg
             * sku_price : 0.01
             * sku_product_text : 小+1斤，2斤，3斤，
             */

            @SerializedName("goods_title")
            private String goodsTitle;
            @SerializedName("goods_id")
            private String goodsId;
            @SerializedName("cart_id")
            private String cartId;
            @SerializedName("sku_sum")
            private String skuSum;
            @SerializedName("sku_product_id")
            private String skuProductId;
            @SerializedName("unit")
            private String unit;
            @SerializedName("imgs")
            private String imgs;
            @SerializedName("sku_price")
            private String skuPrice;
            @SerializedName("sku_product_text")
            private String skuProductText;

            public String getGoodsTitle() {
                return goodsTitle;
            }

            public void setGoodsTitle(String goodsTitle) {
                this.goodsTitle = goodsTitle;
            }

            public String getGoodsId() {
                return goodsId;
            }

            public void setGoodsId(String goodsId) {
                this.goodsId = goodsId;
            }

            public String getCartId() {
                return cartId;
            }

            public void setCartId(String cartId) {
                this.cartId = cartId;
            }

            public String getSkuSum() {
                return skuSum;
            }

            public int getSkuSumI() {
                try {
                    return Integer.valueOf(skuSum);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return 1;
            }

            public void setSkuSum(String skuSum) {
                this.skuSum = skuSum;
            }

            public String getSkuProductId() {
                return skuProductId;
            }

            public void setSkuProductId(String skuProductId) {
                this.skuProductId = skuProductId;
            }

            public String getUnit() {
                return unit;
            }

            public void setUnit(String unit) {
                this.unit = unit;
            }

            public String getImgs() {
                return imgs;
            }

            public void setImgs(String imgs) {
                this.imgs = imgs;
            }

            public String getSkuPrice() {
                return skuPrice;
            }

            public Float getSkuPriceF() {
                try {
                    return Float.valueOf(skuPrice);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return 0.0f;
            }

            public void setSkuPrice(String skuPrice) {
                this.skuPrice = skuPrice;
            }

            public String getSkuProductText() {
                return skuProductText;
            }

            public void setSkuProductText(String skuProductText) {
                this.skuProductText = skuProductText;
            }
        }
    }
}
